package com.axiu;

import android.animation.Animator;
import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RelativeLayout;

public class ExplainActivity extends Activity implements OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_explain);
        Button back = (Button) findViewById(R.id.top_bar_back);
        RelativeLayout tsa_introduce = (RelativeLayout) findViewById(R.id.tsa_introduce);
        RelativeLayout control_explain = (RelativeLayout) findViewById(R.id.control_explain);
        RelativeLayout typical_sys = (RelativeLayout) findViewById(R.id.typical_sys);
        RelativeLayout call_center = (RelativeLayout) findViewById(R.id.call_center);
        RelativeLayout about = (RelativeLayout) findViewById(R.id.about);


        tsa_introduce.setOnClickListener(this);
        control_explain.setOnClickListener(this);
        typical_sys.setOnClickListener(this);
        call_center.setOnClickListener(this);
        about.setOnClickListener(this);

        back.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {

               // Intent intent = new Intent(ExplainActivity.this, MainActivity.class);
                //startActivity(intent);
                //overridePendingTransition(android.R.anim.slide_out_right, android.R.anim.slide_out_right);
            }
        });

    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        int id = v.getId();
        switch (id){
            case R.id.tsa_introduce:
                intent.putExtra("title",getString(R.string.tsa_introduce));
                intent.putExtra("content",getString(R.string.tsa_introduce_content));
            break;
            case R.id.control_explain:
                intent.putExtra("title",getString(R.string.control_explain));
                intent.putExtra("content",getString(R.string.control_explain_content));
                break;
            case R.id.typical_sys:
                intent.putExtra("title",getString(R.string.typical_sys));
                intent.putExtra("content",getString(R.string.typical_sys_content));
                break;
            case R.id.call_center:
                intent.putExtra("title",getString(R.string.call_center));
                intent.putExtra("content",getString(R.string.call_center_content));
                break;
            case R.id.about:
                intent.putExtra("title",getString(R.string.about));
                intent.putExtra("content",getString(R.string.about_content));
                break;
        }
        intent.setClass(ExplainActivity.this, ContentActivity.class);
        startActivity(intent);
    }
}
